<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript">
	$(function() {
		$('#user_reg_regForm input').bind('keyup', function(event){
			/* 增加回车提交注册功能 */
			if(event.keyCode == '13') {
				reg();
			}
		});
	});
	
	function reg() {
		if ($('#user_reg_regForm').form('validate')) {
			$.ajax({
				type : 'POST',
				url : '${pageContext.request.contextPath}/userAction!reg.action',
				data : $('#user_reg_regForm').serialize(),
				dataType : 'json',
				success : function(obj) {
					if (obj.success) {
						$('#user_reg_regDialog').dialog('close');
					}

					$.messager.show({
						title : '提示',
						msg : obj.msg
					});
				}
			});
		}
	}
</script>
<div id="user_reg_regDialog" class="easyui-dialog" data-options="title: '注册', modal:true, closed: true, buttons:[{
				text:'注册',
				iconCls:'icon-edit',
				handler:reg
			}]">
	<form id="user_reg_regForm" method="post">
		<table>
			<tr>
				<th>用户名</th>
				<td><input name="name" class="easyui-validatebox" data-options="required:true, missingMessage: '用户名不能为空'" /></td>
			</tr>
			<tr>
				<th>密码</th>
				<td><input name="pwd" type="password" class="easyui-validatebox" data-options="required:true, missingMessage: '密码不能为空'" /></td>
			</tr>
			<tr>
				<th>重复密码</th>
				<td><input name="rePwd" type="password" class="easyui-validatebox" data-options="required:true, validType:'eqPwd[\'#user_reg_regForm input[name=pwd]\']'" /></td>
			</tr>
		</table>
	</form>
</div>